<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新闻编辑</title>
    <#assign base=request.contextPath/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${base}/admin/MyStatic/frame/layui/css/layui.css" media="all">
    <script src="${base}/admin/MyStatic/js/jquery.min.js"></script>
    <script src="${base}/admin/MyStatic/frame/layui/layui.js"></script>
    <script src="${base}/admin/MyStatic/js/wangEdit/wangEditor.js"></script>

    <style type="text/css">
        form {
            padding: 20px;
        }
    </style>

</head>
<body>
<#if newsEdit.code==0 >
    <form class="layui-form" action="" lay-filter="new_one_init">

        <div class="layui-form-item">
            <label class="layui-form-label">新闻标题</label>
            <div class="layui-inline">
                <input type="text" name="title" required lay-verify="required" value="${newsEdit.data.title}"
                       placeholder="请输入标题" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">

            <label class="layui-form-label">封面图</label>
            <div class="layui-input-block">
                <input type="text" name="title" required lay-verify="required" value="${newsEdit.data.imgCover!}"
                       placeholder="封面图" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新闻来源</label>
            <div class="layui-inline">
                <input type="text" name="title" required lay-verify="required" value="${newsEdit.data.source!}"
                       placeholder="新闻来源" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新闻内容</label>
            <div class="layui-inline" id="news_details">
                <p>${newsEdit.data.details}</p>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否展示</label>
            <div class="layui-inline">
                <select name="city" lay-verify="required">
                    <option value="true" <#if newsEdit.data.isShow?? && newsEdit.data.isShow ==true>selected</#if>>是
                    </option>
                    <option value="false" <#if newsEdit.data.isShow?? && newsEdit.data.isShow ==false>selected</#if>>否
                    </option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否置顶</label>
            <div class="layui-inline">
                <select name="city" lay-verify="required">
                    <option value="true">是</option>
                    <option value="false" selected>否</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-radius" lay-submit="" type="button" onclick="sub()" lay-filter=""
                        style="background-color: #0092EF;">立即提交
                </button>
                <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius">重置</button>
            </div>
        </div>
    </form>
<#elseif newsEdit.code !=0>
    <script>
        layui.use(['form', 'layedit', 'laydate', 'table'], function () {
            var msg = "${newsEdit.msg}";
            var layer = layui.layer;
            layer.open({
                title: ''
                , content: msg
            });

        });
    </script>
</#if>
</body>
<script type="text/javascript" src="${base}/admin/MyStatic/js/index.js"></script>
<script type="text/javascript" src="${base}/admin/MyStatic/js/config.js"></script>
<script type="text/javascript">
    layui.use(['form', 'layedit'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit

    });
    var E = window.wangEditor;
    var editor = new E('#news_details');
    Common().uploadeImgCom(editor);

</script>

</html>